import { request } from '@/utils'

export function getCategoryList(categoryDTO) {
  return request({
    url: '/admin/getCategoryList',
    method: 'POST',
    data: JSON.stringify(categoryDTO),
    headers: {
      'Content-type': 'application/json;charset=utf-8',
    },
  })
}

export function addCategory(categoryForm) {
  return request({
    url: '/admin/category',
    method: 'POST',
    data: JSON.stringify(categoryForm),
    headers: {
      'Content-type': 'application/json;charset=utf-8',
    },
  })
}

export function deleteCategory(id) {
  return request({
    url: '/admin/deleteCategory',
    method: 'POST',
    data: JSON.stringify(id),
    headers: {
      'Content-type': 'application/json;charset=utf-8',
    },
  })
}

export function updateCategory(categoryForm) {
  return request({
    url: '/admin/updateCategory',
    method: 'POST',
    data: JSON.stringify(categoryForm),
    headers: {
      'Content-type': 'application/json;charset=utf-8',
    },
  })
}
